package com.tianhui.service;

import com.tianhui.dao.Arr;
import com.tianhui.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Optional;

@Service
@Transactional
public class Demo implements Up {
    @Autowired
    private Arr arrline;

    @Override
    public List findAll() throws Exception{
        return arrline.findAll();
    }
    @Override
    public void updateNameById(Integer id, String name) throws Exception {
    arrline.updateNameById(id,name);
    }
    @Override
    public Optional<User> findById(Integer id) throws Exception {
        return  arrline.findById(id);
    }
    @Override
    public void deleteById(Integer id) throws Exception {
        arrline.deleteById(id);
    }
    @Override
    public User save(User user) throws Exception {
        return arrline.save(user);
    }
}